<?php
class MY_Controller extends Controller
{
    var $data;
    var $layout;
    var $default_template = "default";
    
    const META_TITLE        = 'meta_title';
    const META_DESCRIPTION  = 'meta_description';
    const META_KEYWORDS     = 'meta_keyword';
    
    const JS_FILES  = 'js_files';
    const JS_VARS   = 'js_vars';
    const CSS_FILES = 'css_files';
    
    const VIEW_FILE = 'view_file';
    
    function MY_Controller() 
    {
        parent::Controller();
        $this->profiler_trigger();
    }
    
    private function profiler_trigger() {
        if(!empty($_REQUEST["debug"]) && $_REQUEST["debug"] == "enabled")
        {
            $this->output->enable_profiler(TRUE);
        }
    }
    
    function post_render_view()
    {
        if (empty($this->layout[MY_Controller::VIEW_FILE]))
        {
            return;
        }
        $this->load->view($this->default_template, &$this->data);
    }
}